import java.util.Scanner;
public class PrimeNumber1 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int N;
        System.out.print("你想求1~N的质数，N=？") ;
        N=scanner.nextInt();
        for (int n=2;n<=N;n++){
            boolean b = true;
            if (n != 1 ){
                for (int i = 2; i < n; i++){
                    if (n % i == 0){
                        b = false;
                        break; } } }
            if (b){
                System.out.println(n + "是质数"); }
        }
    }
}